#include "include.h"
#include "gui/gui.h"


#include "compile/debug_memoryleaks"

using namespace gui;

Gui::Gui(app::Root* const _root, actions::ActionInvoker* const _invoker)
: graphicview(NULL), root(_root), invoker(_invoker)
{
    //ctor
}

Gui::~Gui()
{
    //dtor
    done();
}


void Gui::init()
{
    done();
    buildView();
	setDocumentRoot(root);

}


void Gui::setDocumentRoot(app::Root* root)
{
	if (graphicview)
	{
		graphicview->setDocumentRoot(root);
	}
}


void Gui::done()
{
    setDocumentRoot(NULL);

    this->destroyView();
}








/*

#if !defined(USE_QT) && !defined(USE_WXW)

void Gui::buildView()
{
    graphicview = NULL;
}

void Gui::destroyView()
{
    graphicview = NULL;
}

#endif

*/

